|
|
I have created such a #macro:
#macro createSpline(arr, arrSize, name)
#local length = 0;
#local i = 0;
#while(i < arrSize - 1)
#local length = length + vlength(arr[i+1] - arr[i]);
#local i = i + 1;
#end
#local overallLength = length;
#local length = 0;
#local i = 0;
#local sp = spline {
natural_spline
0.00, arr[0],
#while(i < arrSize - 1)
#local length = length + vlength(arr[i+1] - arr[i]);
length/overallLength, arr[i+1],
#local i = i + 1;
#end
1.00, arr[arrSize - 1]
}
#declare name = sp;
#end
So I can use it in this way:
#declare new_spline = 0;
createSpline(myArr, 5, new_spline)
//here I have new_spline filled with spline object
But my intention is to create a #macro that returns spline by value, not by
parameter as above. I could then use my #macro in this way:
#declare new_spline = createSpline(myArr, 5);
//where myArr is an array with points defining a curve
Question 2: Is there any way (other than using #ifdef command) to check the size
of an array?
Best regards,
twister
Post a reply to this message
|
|